/*kZime*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <algorithm>
#define MAXN 

using namespace std;

int n, f[1233];

inline int read() {
	int k = 0, f = 1; char c = getchar();
	for(; !isdigit(c); c = getchar())if(c == '-') f = -1;
	for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
	return k * f;
}

//void dfs(int k) {
//	sum++;
//	for(int i = 1; i <= k / 2; i++){
//		dfs(i);
//	}
//	return;
//}

int main() {
#ifndef LOCAL
	freopen("nums.in", "r", stdin);
	freopen("nums.out", "w", stdout);
#else 
	freopen("in.txt", "r", stdin);
#endif
//	memset(f, 1, sizeof(f));
	n = read();
	f[1] = 1;
	for(int i = 2; i <= n; i++) {
		if(i % 2) f[i] = f[i-1];
		else f[i] = f[i - 1] + f[i / 2];
	}
	printf("%d", f[n]);
	return 0;
}

